package com.lostandfound.entity;
/**  
* 
*  
* @date 2018年3月11日
*/

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "laf_topic_t")
public class Topic implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long tid;//主贴ID
	private String tname;//主贴名称
	private String item_type;//物品种类
	private String lost_address;//丢失地点
	private String tcontent;//主贴内容
	private Date lost_time;//丢失时间
	private String contact;//联系人
	private String contact_tel;//联系方式
	private String contact_email;//e-mail
	private Date t_create_time;//创建时间
	private Date t_end_time;//完结时间
	private User user;//创建者
	private Plate plate;//所属板块
	private String tstatus = "0";//状态：0正常，1结案，2禁言，3删除

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY) 
    @Column(name = "t_id", unique = true, nullable = false, length = 8)
	public Long getTid() {
		return tid;
	}
	public void setTid(Long tid) {
		this.tid = tid;
	}
	
	
	@Column(name = "t_name",nullable = false, length = 64)
	public String getTname() {
		return tname;
	}
	public void setTname(String tname) {
		this.tname = tname;
	}
	
	
	@Column(name = "t_item_type",nullable = false, length = 32)
	public String getItem_type() {
		return item_type;
	}
	public void setItem_type(String item_type) {
		this.item_type = item_type;
	}
	

	@Column(name = "t_lost_address",nullable = false, length = 64)
	public String getLost_address() {
		return lost_address;
	}
	public void setLost_address(String lost_address) {
		this.lost_address = lost_address;
	}
	
	
	@Column(name = "t_content",nullable = false, length = 600)
	public String getTcontent() {
		return tcontent;
	}
	public void setTcontent(String tcontent) {
		this.tcontent = tcontent;
	}
	

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "t_lost_time", length = 7)
	public Date getLost_time() {
		return lost_time;
	}
	public void setLost_time(Date lost_time) {
		this.lost_time = lost_time;
	}

	@Column(name = "t_contact",nullable = false, length = 32)
	public String getContact() {
		return contact;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	

	@Column(name = "t_contact_tel",nullable = false, length = 24)
	public String getContact_tel() {
		return contact_tel;
	}
	public void setContact_tel(String contact_tel) {
		this.contact_tel = contact_tel;
	}
	

	@Column(name = "t_contact_email",nullable = false, length = 24)
	public String getContact_email() {
		return contact_email;
	}
	public void setContact_email(String contact_email) {
		this.contact_email = contact_email;
	}
	
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "t_create_time", length = 7)
	public Date getT_create_time() {
		return t_create_time;
	}
	public void setT_create_time(Date t_create_time) {
		this.t_create_time = t_create_time;
	}
	
	
	@Column(name = "t_status",nullable = false, length = 1)
	public String getTstatus() {
		return tstatus;
	}
	public void setTstatus(String tstatus) {
		this.tstatus = tstatus;
	}
	
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "t_end_time", length = 7)
	public Date getT_end_time() {
		return t_end_time;
	}
	public void setT_end_time(Date t_end_time) {
		this.t_end_time = t_end_time;
	}
	
	
	@ManyToOne
	@JoinColumn(name="id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	
	@ManyToOne
	@JoinColumn(name="pid")
	public Plate getPlate() {
		return plate;
	}
	public void setPlate(Plate plate) {
		this.plate = plate;
	}
	
	public Topic() {
		super();
	}
	
	public Topic(Long tid, String tname, String item_type, String lost_address, String tcontent, Date lost_time,
			String contact, String contact_tel, String contact_email, Date t_create_time, String tstatus, Date t_end_time,
			User user, Plate plate) {
		super();
		this.tid = tid;
		this.tname = tname;
		this.item_type = item_type;
		this.lost_address = lost_address;
		this.tcontent = tcontent;
		this.lost_time = lost_time;
		this.contact = contact;
		this.contact_tel = contact_tel;
		this.contact_email = contact_email;
		this.t_create_time = t_create_time;
		this.tstatus = tstatus;
		this.t_end_time = t_end_time;
		this.user = user;
		this.plate = plate;
	}
	
}
